/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rie06.openvoip.client.IHM.communication;

import com.rie06.openvoip.client.Conversation;
import com.rie06.openvoip.client.IHM.communication.WindowDialog;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.TextArea;
import java.awt.geom.Dimension2D;
import javax.swing.JButton;
import javax.swing.JPanel;
import org.apache.log4j.Logger;

/**
 *
 * @author Sylvain
 */
public class PanelMessage extends JPanel {
    
    private WindowDialog dialogWindow;
    private CommunicationController communicationController;
    private TextArea zoneConversation;
    private TextArea zoneText;
    private JButton sendButton;
    private Conversation conversation;
    private static final Logger logger = Logger.getLogger(PanelMessage.class);
    
    public PanelMessage (WindowDialog dialogWindow, CommunicationController communicationController, Conversation conversation){
        
        this.dialogWindow = dialogWindow;
        this.communicationController = communicationController;
        this.conversation = conversation;
        
        this.setPreferredSize(new Dimension(345, 700));
        this.setBackground(Color.white);
        
        zoneConversation = new TextArea();
        zoneConversation.setEditable(false);
        zoneConversation.setPreferredSize(new Dimension(345,420));
 
        zoneText = new TextArea();
        zoneText.setEditable(true);
        zoneText.setPreferredSize(new Dimension(350, 80));

        sendButton = new JButton("Envoyer");
     
        this.add(sendButton);

        sendButton.addActionListener(this.communicationController);
        sendButton.setActionCommand("sendMessage");
        
        this.add(zoneConversation);
        this.add(zoneText);
        this.add(sendButton);

    }

    public WindowDialog getDialogWindow() {
        return dialogWindow;
    }

    public JButton getSendButton() {
        return sendButton;
    }

    public TextArea getZoneText() {
        return zoneText;
    }

    public void setZoneText(TextArea zoneText) {
        this.zoneText = zoneText;
    }

    public TextArea getZoneConversation() {
        return zoneConversation;
    }

    public void setZoneConversation(TextArea zoneConversation) {
        this.zoneConversation = zoneConversation;
    }

    public Conversation getConversation() {
        return conversation;
    }

    public void setConversation(Conversation conversation) {
        this.conversation = conversation;
    }
    
    
    
    
}
